/*
Copyright (C) 2009  Raymond Jeon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef __GL_LIB_SOCKET_H__
#define __GL_LIB_SOCKET_H__



// -1  SOCKET_ERROR
//  0  nonblock 
// > 0 return byte

typedef int		SOCKRET;	




int	GlSockStartup();
int	GlSockCleanup();
SOCKRET	GlSockSendTimeOut		(int hSocket, const char *szBuffer, int iLen, int iFlags);
SOCKRET	GlSockSendToTimeOut		(int hSocket, const char *szBuffer, int iLen, int iFlags, const struct sockaddr *saTo,  int iToLen);
SOCKRET	GlSockRecvTimeOut		(int hSocket, char* szBuffer, int iLen, int iFlags);
SOCKRET	GlSockRecvFromTimeOut	(int hSocket, char* szBuffer, int iLen, int iFlags, struct sockaddr *saFrom,  int *iFromLen);
SOCKRET	GlSockRecvLineTimeOut	(int hSocket, char* szBuffer, int iLen, int iFlags);



#endif	// __GL_LIB_SOCKET_H__

